<?php
//获取openid
$openid = '';
if(isset($_GET['openid'])){
    $openid = $_GET['openid'];
}
if (isset($message)) {
   echo "<script type=text/javascript> $('#input_more').hide();</script>";
   echo "<script type=text/javascript>location.reload();</script>";  
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl.'/css/BWeMember/wei_webapp_new.css'?>">
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl.'/css/BWeMember/wei_dialog.css'?>">
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl.'/css/BWeMember/common.css'?>">

<script type="text/javascript">
    $(document).ready(function(){
        $("#input_more").click(function(){
          $("#more_info").slideToggle(1000,modifyContent());
        });
         $('#inBirthYear').change(function(){
             getBirth();
        });
         $('#inBirthMonth').change(function(){
             getBirth();
        });
         $('#inBirthDay').change(function(){
             getBirth();
        });
        function modifyContent(){
           if($("#input_more").text() == '输入更多'){
               $("#input_more").text('收起');
           }else
               $("#input_more").text('输入更多');
        }
        function getBirth(){
            var year = $("#inBirthYear").val();
            var month =$("#inBirthMonth").val();
            var day =$("#inBirthDay").val();
            var  birth  = year+"-"+month+"-"+day;//2012-11-16
//            var unix = datetime_to_unix(birth);
            $("#BDynamicFormModel_media_birth_add_userInfo").val(birth);
        }
//        function datetime_to_unix(datetime){
//            var tmp_datetime = datetime.replace(/:/g,'-');
//            tmp_datetime = tmp_datetime.replace(/ /g,'-');
//            var arr = tmp_datetime.split("-");
//            var now = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
//            return parseInt(now.getTime()/1000);
//        }
//       if (isset($message)) {
//         $('#input_more').hide();
//       }
    });
</script>
<!-- ajax加载页面时弹出加载旋转gif图 -->
<style>
    #ajax-loaderdiv {position: fixed;top: 0;left: 0;width: 100%;height: 100%;z-index: 35000;background-color: rgba(0, 0, 0, 0.3);display: none;}
    .ajax-loader {position: absolute;left: 50%;top: 50%;margin-left: -16px;margin-top: -16px;display: block;}
</style>
<div id="ajax-loaderdiv" style="display: none;">
    <img src="<?php echo Yii::app()->request->baseUrl.'/images/ajax-loader.gif'?>" class="ajax-loader">
</div>


<div id="page_card" class="div-body">

    <div id="mappContainer">
        <div class="inner root" style="height: 519px;">
            <div class="card" style="background:url(<?php echo Yii::app()->request->baseUrl.'/images/BWeMember/wei_webapp_new/card_bk_1.png'?>) no-repeat 0 0;-webkit-background-size:267px 159px;background-size:267px 159px;" data-card-type="0">
                <img src="<?php echo Yii::app()->request->baseUrl.'/images/BWeMember/weixin_shop_logo/2543529110_card_170_170.png'?>" class="logo">
                <h1></h1>
                <!--<strong class="pdo verify"><span style="color:#92714e;text-shadow:0 1px #f1e7dc;"><em style="color:#92714e;text-shadow:0 1px #f1e7dc;">会员卡号</em>798 4202</span></strong>-->
            </div>
            <p><span>请输入信息认证！</span></p>
        <?php
        $form = $this->beginWidget('CActiveForm', array(
            "id" => "manage-myInfo-form",
            'enableAjaxValidation' => FALSE,
            'htmlOptions' => array('class' => 'form-signin', 'role' => 'form'),
                ));
        ?>
            <ul class="round" id="customs" style="margin-bottom:0px;">
                <li>
                    <a style="background-size: 0px;float: left;line-height: 23px;">手机号：</a>
                            <?php
                            $htmlOptions = array('placeholder' => '手机号');
                            $htmlOptions['require'] = TRUE;
                            if ($model->$mobileField != NULL && !isset($wrongMobile)) {
                                $htmlOptions['disabled'] = TRUE;
                            }
                            echo CHtml::activeTextField($model, $mobileField, $htmlOptions);
                            if (isset($wrongMobile)) {
                                echo '<h6 class="text-error"><mark>' . $wrongMobile . '</mark></h6>';
                            }
                            ?>
                </li>
            </ul>
            <p style="margin-bottom: 10px;"><span><a href="#" id="input_more">输入更多</a></span></p>
            <ul class="round" id="more_info" style="display:none;">
                <li>
                    <a style="background-size: 0px;float: left;line-height: 23px;">Email：</a>
                            <?php
                            $htmlOptions = array('placeholder' => '电邮');
                            $htmlOptions['require'] = TRUE;
                            if ($model->$emailField != NULL && !isset($wrongEmail)) {
                                $htmlOptions['disabled'] = TRUE;
                            }
                            echo CHtml::activeTextField($model, $emailField, $htmlOptions);
                            if (isset($wrongEmail)) {
                                echo '<h6 class="text-error"><mark>' . $wrongEmail . '</mark></h6>';
                            }
                            ?>
                </li>
                <li>
                    <a style="background-size: 0px;float: left;line-height: 23px;">尊&nbsp;姓：</a>
                           <?php
                            echo CHtml::activeDropDownList($model, $genderField, array('mister' => '先生', 'lady' => '女士', 'boy' => '男孩', 'girl' => '女孩'), array('placeholder' => '性别' . '...', 'class' => 'span2'));
                            echo CHtml::activeTextField($model, $familyNameField, array('placeholder' => '姓氏' . '...', 'required' => true));
                            ?>
                </li>
                <li>
                    <a style="background-size: 0px;float: left;line-height: 23px;">大&nbsp;名：</a>
                            <?php
                            echo CHtml::activeTextField($model, $surNameField, array('placeholder' => '名字' . '...', 'required' => true));
                            ?>
                </li>
                <li style="height: 50px;">
                    <a style="background-size: 0px;float: left;line-height: 23px;margin-top: 2px;">生&nbsp;日：</a>
                            <?php
                            echo CHtml::activeTextField($model, $birthField, array('placeholder' => '生日' . '...', 'required' => true,'style'=>'display: none',));
                            ?>
                    <select class="mod_input qb_mb10 qb_flex" id="inBirthYear" style="padding:0px;margin:0px 2px 0 0;float:left;height: 31px;line-height:31px;font-size: 14px;outline: none;" onchange="chooseDate(false);">
                        <option value="0">年</option>
                        <option value="2014">2014</option>
                        <option value="2013">2013</option>
                        <option value="2012">2012</option>
                        <option value="2011">2011</option>
                        <option value="2010">2010</option>
                        <option value="2009">2009</option>
                        <option value="2008">2008</option>
                        <option value="2007">2007</option>
                        <option value="2006">2006</option>
                        <option value="2005">2005</option>
                        <option value="2004">2004</option>
                        <option value="2003">2003</option>
                        <option value="2002">2002</option>
                        <option value="2001">2001</option>
                        <option value="2000">2000</option>
                        <option value="1999">1999</option>
                        <option value="1998">1998</option>
                        <option value="1997">1997</option>
                        <option value="1996">1996</option>
                        <option value="1995">1995</option>
                        <option value="1994">1994</option>
                        <option value="1993">1993</option>
                        <option value="1992">1992</option>
                        <option value="1991">1991</option>
                        <option value="1990">1990</option>
                        <option value="1989">1989</option>
                        <option value="1988">1988</option>
                        <option value="1987">1987</option>
                        <option value="1986">1986</option>
                        <option value="1985">1985</option>
                        <option value="1984">1984</option>
                        <option value="1983">1983</option>
                        <option value="1982">1982</option>
                        <option value="1981">1981</option>
                        <option value="1980">1980</option>
                        <option value="1979">1979</option>
                        <option value="1978">1978</option>
                        <option value="1977">1977</option>
                        <option value="1976">1976</option>
                        <option value="1975">1975</option>
                        <option value="1974">1974</option>
                        <option value="1973">1973</option>
                        <option value="1972">1972</option>
                        <option value="1971">1971</option>
                        <option value="1970">1970</option>
                        <option value="1969">1969</option>
                        <option value="1968">1968</option>
                        <option value="1967">1967</option>
                        <option value="1966">1966</option>
                        <option value="1965">1965</option>
                        <option value="1964">1964</option>
                        <option value="1963">1963</option>
                        <option value="1962">1962</option>
                        <option value="1961">1961</option>
                        <option value="1960">1960</option>
                        <option value="1959">1959</option>
                        <option value="1958">1958</option>
                        <option value="1957">1957</option>
                        <option value="1956">1956</option>
                        <option value="1955">1955</option>
                        <option value="1954">1954</option>
                        <option value="1953">1953</option>
                        <option value="1952">1952</option>
                        <option value="1951">1951</option>
                        <option value="1950">1950</option>
                        <option value="1949">1949</option>
                        <option value="1948">1948</option>
                        <option value="1947">1947</option>
                        <option value="1946">1946</option>
                        <option value="1945">1945</option>
                        <option value="1944">1944</option>
                        <option value="1943">1943</option>
                        <option value="1942">1942</option>
                        <option value="1941">1941</option>
                        <option value="1940">1940</option>
                        <option value="1939">1939</option>
                        <option value="1938">1938</option>
                        <option value="1937">1937</option>
                        <option value="1936">1936</option>
                        <option value="1935">1935</option>
                        <option value="1934">1934</option>
                        <option value="1933">1933</option>
                        <option value="1932">1932</option>
                        <option value="1931">1931</option>
                        <option value="1930">1930</option>
                        <option value="1929">1929</option>
                        <option value="1928">1928</option>
                        <option value="1927">1927</option>
                        <option value="1926">1926</option>
                        <option value="1925">1925</option>
                        <option value="1924">1924</option>
                        <option value="1923">1923</option>
                        <option value="1922">1922</option>
                        <option value="1921">1921</option>
                        <option value="1920">1920</option>
                        <option value="1919">1919</option>
                        <option value="1918">1918</option>
                        <option value="1917">1917</option>
                        <option value="1916">1916</option>
                        <option value="1915">1915</option>
                        <option value="1914">1914</option>
                    </select>

                    <!--<input  name ="upgradeinput" type="date" id="birthtxt" class="flex_box" placeholder="年" maxlength="4" />-->
                    <select class="mod_input qb_mb10 qb_flex" id="inBirthMonth" style="padding:0px;margin:0px 2px 0 0;line-height:31px;float:left;height: 31px;font-size: 14px;outline: none;" onchange="chooseDate(false);">
                        <option value="0">月</option>
                        <option value="01">1</option>
                        <option value="02">2</option>
                        <option value="03">3</option>
                        <option value="04">4</option>
                        <option value="05">5</option>
                        <option value="06">6</option>
                        <option value="07">7</option>
                        <option value="08">8</option>
                        <option value="09">9</option>
                        <option value="10">10</option>
                        <option value="11">11</option>
                        <option value="12">12</option>
                    </select>

                    <!--<input  name ="upgradeinput" type="date" id="birthtxt" class="flex_box" placeholder="年" maxlength="4" />-->
                    <select class="mod_input qb_mb10 qb_flex" id="inBirthDay" style="padding:0px;margin:0px 2px 0 0;line-height:31px;float:left;height: 31px;font-size: 14px;outline: none;">
                        <option value="0">日</option>
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5</option>
                        <option value="6">6</option>
                        <option value="7">7</option>
                        <option value="8">8</option>
                        <option value="9">9</option>
                        <option value="10">10</option>
                        <option value="11">11</option>
                        <option value="12">12</option>
                        <option value="13">13</option>
                        <option value="14">14</option>
                        <option value="15">15</option>
                        <option value="16">16</option>
                        <option value="17">17</option>
                        <option value="18">18</option>
                        <option value="19">19</option>
                        <option value="20">20</option>
                        <option value="21">21</option>
                        <option value="22">22</option>
                        <option value="23">23</option>
                        <option value="24">24</option>
                        <option value="25">25</option>
                        <option value="26">26</option>
                        <option value="27">27</option>
                        <option value="28">28</option>
                        <option value="29">29</option>
                        <option value="30">30</option>
                        <option value="31">31</option>
                    </select>
                </li>
            <?php
                echo CHtml::activeTextField($model, $openidField, array(
                    'style'=>'display: none',
                    'placeholder' => 'openid',
                    'value'=>$openid,
                    'required' => 'true'));
                ?>
            </ul>
            <?php
            if (isset($message)) {
                 echo '<p class="text-success"><mark>' . $message . '</mark></p>';
            }
            if (isset($error)) {
                 echo '<p class="text-success"><mark>' . $error . '</mark></p>';
            }
            echo $control->getAjaxLink('保存信息', array(
                'cooker' => 'BAUserCooker@bindUserInfo',
                'htmlOptions' => array(
                    'class' => 'btn-primary btn-lg btn-block')));
            ?>
        <?php $this->endWidget(); ?>
        </div>
    </div>

    <div id="mCopyright" style="margin-top: 50px;">
        <div class="mcrInn">
            <h1>比邻平台</h1>
        </div>
    </div>

</div>